package cn.com.ejiakanghu.core.utils;

import org.apache.commons.lang.StringUtils;

/**
 * @author houzb
 * @Description
 * @create 2021-12-01 15:36
 */
public class ParamUtils {

    public static boolean isDecimal(String str) {
        if(StringUtils.isBlank(str)) {
            return false;
        }
        boolean isDot = str.contains(".");
        if(!isDot) {
            return false;
        }
        String[] arr = str.split("\\.");
        if(arr.length == 1) {
            return false;
        }
        boolean rst = isNum(arr[0]) && isNum(arr[1]);
        return rst;
    }

    public static boolean isNum(String str) {
        return StringUtils.isNumeric(str);
    }

    public static void main(String[] args) {
        String t = "a";
        System.out.println(isDecimal(t));
    }
}
